pp108 : Delegate Task

Delegate Task

This method is used to delegate a task to another user. 

Resource URI
/v1/tasks/delegateTask
Request Type

HTTP POST

HTTP Header Parameters

Parameter

Description

Accepted Input Values

SAMLart

The SAML artifact received after authentication. For more information on how to authenticate, see Login.

otdsticket

The OTDSTicket received after authentication from OTDS. The OTDSTicket must be provided as a header parameter. For more information on how to authenticate, see Login.

Note : You must provide either SAMLart or otdsticket header parameter. If you provide both the header parameters, it will internally work based on SAMLart. 

 

Note: The supported output formats are:

  • JSON
  • XML
Request Parameters
Parameter Descrption  

TransferOwnership

Ownership of the task.

If TransferOwnership is set to:

  • true - The ownership of the task is transferred along with the task to the delegated user. The is the default value.
  • false - The ownership of the task is not transferred to the delegated user. 

delegateTo

UserDN of the user to whom the task is delegated.

Note: The user and the owner of the task must belong to the same work list. For example:

cn=lgautam,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net

Memo

Contains the contents in the memo.

Usually, the reason for delegating the task is provided here.

DueDate

Date by which the task must be completed.

Any date value
TaskId

Unique identifier of the task.

String value. This ID can be retrieved using the GetTasks API.

Note: All the above parameters must be send inside attribute value of the DelegateTask object in the payload section of the HTTP POST call. 

Sample HTTP Payload

POST accepts the payload content only in the XML format as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DelegateTask xmlns="http://schemas.cordys.com/notification/workflow/1.0">
 <TaskId>002481F0-8E9F-11E3-FE11-D428C7EB97E1</TaskId>
 <TaskId>002481F0-8E9F-11E3-FE11-E11AB5FED7E1</TaskId>
 <TransferOwnership>true</TransferOwnership>
 <Memo>Test with Obj Delegating WITH OTDS alone NO SMALart </Memo>
 <SendTo>
 <UserDN xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">cn=Test_New_laxman,cn=organizational users,o=system,cn=cordys,cn=OTDS_Cordys1,o=mydomain.com</UserDN>
 </SendTo>
</DelegateTask>
Sample Client Example

Add the HTTP Payload as follows:

public static void main(String[] args) throws JAXBException,ClientProtocolException, IOException {
com.cordys.entity.bean.DelegateTask delegateTaskObj = new com.cordys.entity.bean.DelegateTask();
 delegateTaskObj.setMemo("Test with Obj Delegating WITH OTDS alone NO SMALart ");
 delegateTaskObj.setTransferOwnership(true);
 delegateTaskObj.setTaskId("002481F0-8E9F-11E3-FE11-D428C7EB97E1");
 delegateTaskObj.setTaskId("002481F0-8E9F-11E3-FE11-E11AB5FED7E1");
 com.cordys.entity.bean.DelegateTask.SendTo sendto=new com.cordys.entity.bean.DelegateTask.SendTo();
 sendto.setUserDN("cn=Test_New_laxman,cn=organizational users,o=system,cn=cordys,cn=OTDS_Cordys1,o=mydomain.com");
 delegateTaskObj.setSendTo(sendto);
StringWriter writer = new StringWriter();
 JAXBContext jaxbContext = JAXBContext.newInstance(com.cordys.entity.bean.DelegateTask.class);
 Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
jaxbMarshaller.marshal(delegateTaskObj, writer);
DefaultHttpClient httpClient = new DefaultHttpClient();
 // Define a postRequest request
 HttpPost postRequest = new HttpPost("http://<HOST>:<PORT>/BPMService/v1/tasks/delegateTask");
// Set the API media type in http content-type header
 //postRequest.addHeader("SAMLart","MDEUkKOCWs8vQY+gYqa28mHjKoN0V+gJI8/zKxA4BveCdAA/LA+COJau"); // or
 postRequest.addHeader("otdsticket","ADBZP2eKrln7JjnRaw-RqMB9J3Q9q");
 postRequest.addHeader("content-type", "application/xml");
// Set the request post body
 StringEntity userEntity = new StringEntity(writer.getBuffer().toString());
 postRequest.setEntity(userEntity);
...
 }

Note: The com.cordys.entity.bean.DelegateTask object structure has been attached below, which is expected as a parameter of the REST API:

public Response transferTask(com.cordys.entity.bean.DelegateTask)

DelegateTask.java class is packed on BPMServiceClient.jar.

Response Parameters

Parameter

Description

TaskId

Contains the unique identifier of the task

ParentTaskId

This ID is used to group all the tasks which are assigned to the same role with the All linked users must execute the task option enabled in the Activity Properties interface. Refer to the Activity Properties Interface topic in the Product Documentation for more information.

component

Component from which the task has been triggered

activityId

The ID of the activity from which the task has been raised

targets

Type of target where the task is sent

processInstanceId

Contains the unique identifier of the source that created the task

state

Contains the current state of the task

processName

Contains the name of the source that created the task

activity

Contains the subject of the task

sender

Contains the DN of the sender of the task. It has the following attributes:

  • displayName - Display name of the user as mentioned in the user manager or as it is in the LDAP
  • phone1 - Phone number as mentioned in the contact details while creating a user
  • phone2 - Phone number as mentioned in the contact details while creating a user
  • email - Email ID as mentioned in the contact details while creating a user

assignee

Contains the DN of the assignee, who claims the task or to whom the task is assigned by the manager. It has the following attributes:

  • displayName - Display name of the user as mentioned in the user manager or as it is in the LDAP
  • phone1 - Phone number as mentioned in the contact details while creating a user
  • phone2 - Phone number as mentioned in the contact details while creating a user
  • email - Email ID as mentioned in the contact details while creating a user

priority

Contains the priority set on the task. It is set between 0 and 5.

  • 0 - Denotes lowest priority
  • 5 - Denotes highest priority

taskData

Contains Application Data and Custom Data

applicationData

Contains the data the task has to perform in the XML format

customData

Contains additional information about the task in the XML format

startDate

Contains date on which the task is supposed to be started

startedOn

Contains date on which the task has actually been started

dueDate

Contains date on which the task is due

loggerContext

Logger context refers to the detailed information about the context of an application and is propagated across all the activities or transactions involved in that application. Refer to the Logger Context topic in the Product Documentation for more information.

deliveryDate

Contains date on which the task is created

completionDate

Contains date on which the task is actually completed

isPriorityFixed

Contains the state of priority.

Note: If 1, the priority cannot be changed.

parentQueue

Contains the work list ID of the parent work list. While transferring the tasks to a different work list, the work list from which the task is transferred is referred as the parent queue.

Sample Response
JSONResponse: {
	Task: [1]0: {
		url: "ui.caf"TaskId: "002481F0-8E9F-11E3-FB98-BD04D5FA7BB1"ParentTaskId: "002481F0-8E9F-11E3-FB98-BD04D5FA7BB1"ProcessInstanceId: "002481F0-8E9F-11E3-FB98-BD04D5FA1BB1"State: "ASSIGNED"ProcessName: "bpmSample"Activity: "Notif Subject"Sender: {
			value: "cn=lgautam,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net"displayName: "lgautam"phone1: ""phone2: ""email: ""
		}-BusinessAttributes: {
			
		}Assignee: {
			value: "cn=NewLaxman,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net"displayName: "NewLaxman User"phone1: ""phone2: ""email: ""
		}-CompletedByUser: {
			value: ""displayName: nullphone1: nullphone2: nullemail: null
		}-LoggerContext: "<Logger xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns="http: //schemas.cordys.com/General/1.0/"><DC name="process">bpmSample</DC><DC name="instance">002481F0-8E9F-11E3-FB98-BD04D5FA1BB1</DC></Logger>"DeliveryDate: "2014-05-16T06:47:12.0"StartDate: "2014-05-16T06:47:12.0"DueDate: {
			value: ""isExpired: false
		}-StartedOn: ""CompletionDate: ""IsPriorityFixed: falsePriority: "3"ParentQueue: "cn=lgautam,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net"ActivityId: "o_2"Component: "BPM"Targets: {
			Target: [1]0: {
				value: "002481F0-8E9F-11E3-FBFC-5DDA03BCBFE3"type: "user"
			}--
		}-TaskData: {
			ApplicationData: {
				any: "<?xml version="1.0" encoding="UTF-16"?> <proc:forminputdata xmlns="http: //schemas.cordys.com/1.0/xforms/processapi" xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/" xmlns:proc="http: //schemas.cordys.com/1.0/xforms/processapi"><proc:freeformcontrols><proc:input1 display_name="Input1"/></proc:freeformcontrols></proc:forminputdata>"
			}-CustomData: {
				any: null
			}-Annotation: {
				any: "<?xml version="1.0" encoding="UTF-16"?> <Annotation xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"
			}-
		}-PossibleActions: {
			COMPLETE: "<?xml version="1.0" encoding="UTF-16"?> <COMPLETE xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"DELEGATE: "<?xml version="1.0" encoding="UTF-16"?> <DELEGATE xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"FORWARD: "<?xml version="1.0" encoding="UTF-16"?> <FORWARD xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"START: "<?xml version="1.0" encoding="UTF-16"?> <START xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"SUSPEND: "<?xml version="1.0" encoding="UTF-16"?> <SUSPEND xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"SKIP: "<?xml version="1.0" encoding="UTF-16"?> <SKIP xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"EXECUTE: "<?xml version="1.0" encoding="UTF-16"?> <EXECUTE xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"VIEW: "<?xml version="1.0" encoding="UTF-16"?> <VIEW xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"TRANSFER: "<?xml version="1.0" encoding="UTF-16"?> <TRANSFER xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"
		}-
	}--
}

 

 

Attachments: